package sample.controller;

import sample.entity.User;
import sample.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (User)表控制层
 *
 * @author makejava
 * @since 2022-01-18 20:17:36
 */
@RestController
@RequestMapping("user")
public class UserController {
	/**
	 * 服务对象
	 */
	@Resource
	private UserService userService;

	/**
	 * 通过主键查询单条数据
	 *
	 * @param id 主键
	 * @return 单条数据
	 */
	@GetMapping("selectOne")
	public User selectOne(Integer id) {
		return this.userService.queryById(id);
	}

}
